From: Dan Winship Date: Tue, 14 Jun 2011 20:02:36 +0000 (-0400) Subject: appDisplay: make the categories list scrollable, if necessary X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8111 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6d5e414863bae8abe7bf62c7ae227c2353bd57aa;p=gnome-shell.git appDisplay: make the categories list scrollable, if necessary https://bugzilla.gnome.org/show_bug.cgi?id=651082 --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index c08e956db..5f38de3a1 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -172,10 +172,12 @@ ViewByCategories.prototype = { // (used only before the actor is mapped the first time) this._currentCategory = -2; this._filters = new St.BoxLayout({ vertical: true, reactive: true }); - this._filters.connect('scroll-event', Lang.bind(this, this._scrollFilter)); - + this._filtersBox = new St.ScrollView({ x_fill: false, + y_fill: false, + style_class: 'vfade' }); + this._filtersBox.add_actor(this._filters); this.actor.add(this._view.actor, { expand: true, x_fill: true, y_fill: true }); - this.actor.add(this._filters, { expand: false, y_fill: false, y_align: St.Align.START }); + this.actor.add(this._filtersBox, { expand: false, y_fill: false, y_align: St.Align.START }); // Always select the "All" filter when switching to the app view this.actor.connect('notify::mapped', Lang.bind(this, @@ -193,14 +195,6 @@ ViewByCategories.prototype = { this.actor.add(this._focusDummy); }, - _scrollFilter: function(actor, event) { - let direction = event.get_scroll_direction(); - if (direction == Clutter.ScrollDirection.UP) - this._selectCategory(Math.max(this._currentCategory - 1, -1)) - else if (direction == Clutter.ScrollDirection.DOWN) - this._selectCategory(Math.min(this._currentCategory + 1, this._sections.length - 1)); - }, - _selectCategory: function(num) { if (this._currentCategory == num) // nothing to do return;